package com.woody.aggregate.shop.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Optional;

/**
 * &copy; All rights Reserved
 * 商圈配置，子门店显示方式
 * @author wénkǎi.zhāng 2025-04-11
 */
@Getter
@RequiredArgsConstructor
public enum ShopShowTypeEnum {

    /**
     * 列表中显示
     */
    LIST(0),

    /**
     * 商圈内展示
     */
    BD(1);

    private final Integer type;


    /**
     * 根据展示方式获取枚举
     *
     * @param showType
     * @return
     */
    public static Optional<ShopShowTypeEnum> fromType(Integer showType) {
        for (ShopShowTypeEnum value : values()) {
            if (value.getType().equals(showType)) {
                return Optional.of(value);
            }
        }

        return Optional.empty();
    }
}
